/*
package com.leyantech.ecp.agenx.web.filter;

import com.leyantech.ecp.agenx.common.service.StoreHomeService;
import com.leyantech.ecp.agenx.web.AuthMessage;
import com.leyantech.storehome.AssistantSeats;

import com.google.inject.Inject;
import lombok.extern.slf4j.Slf4j;

*/
/**
 * @author eahau, {@literal <eahau@foxmail.com>}
 * @date 2022-11-16.
 *//*

@Slf4j
public class AssistantFilter implements AuthFilter {

  private final StoreHomeService storeHomeService;

  @Inject
  public AssistantFilter(StoreHomeService storeHomeService) {
    this.storeHomeService = storeHomeService;
  }

  @Override
  public boolean test(AuthMessage authMessage) {
    final String storeId = authMessage.getStoreId();
    final String assistantId = authMessage.getAssistantId();
    final boolean hasAssistantId = storeHomeService.listStoreAssistant(storeId)
        .stream()
        .map(AssistantSeats::getAssistantId)
        .anyMatch(assistantId::equals);
    if (!hasAssistantId) {
      log.info("store {} can't find assistant {}.", storeId, assistantId);
    }
    return hasAssistantId;
  }

}
*/
